package com.dongyimai.oauth.util;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TokenInterceptor implements RequestInterceptor {

    /**
     * frign 调用之前执行
     */
    @Override
    public void apply(RequestTemplate template) {
        String token = AdminToken.createAdminToken();
        template.header("Authorization","Bearer "+token);
    }


}
